package com.sloth;
class Person{
    private String name;
    private Student student;

    public Person(String name, Student student) {
        this.name = name;
        this.student = student;
    }

    public Person() {
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", student=" + student +
                '}';
    }
}
class Student{
    private int age;

    public Student(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "age=" + age +
                '}';
    }

    public Student() {
    }


    public boolean equals(Object object){


        if (this.toString().equals(((Student) object).toString())){
            return true;
        }
        return false;

    }
}

public class test1 {
    public static void main(String[] args) {

        Student stu1 = new Student(15);
        Student stu2 = new Student(15);
        System.out.println(stu1.equals(stu2));




    }


}
